home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / OOPS / OBJECTA / OBJECTA.DOC next >
Text File  |  1989-07-07  |  2KB  |  73 lines

  1.  
  2.  
  3.  
  4.                              OBJECTA
  5.  
  6.                         A TP 5.5 OOP UNIT
  7.  
  8.             Rob Rosenberger        CIS: 74017,1344
  9.             Barn Owl Software      VOX: (618) 632-7345
  10.             P.O. Box #74           BBS: (618) 398-5703
  11.             O'Fallon, IL  62269    HST: (618) 398-2305
  12.  
  13.      This Turbo Pascal 5.5 unit builds on the OBJECTS.PAS file on
  14. disk three of the TP package.  The Objects unit provides some
  15. excellent linked-list capabilities, but it doesn't allow arbi-
  16. trary placement of a node on the list.  The OBJECTA unit offers a
  17. decendent, LinkList, which provides two methods: LinkList.Before,
  18. to place a node just before some other node in the list, and
  19. LinkList.After, to place a node just after some other node in the
  20. list.
  21.  
  22.      LinkList.Init and LinkList.Done are included because the TP
  23. 5.5 OOP guide recommends these common procedures.  The List
  24. ancestor calls them Clear and Delete, respectively, which I found
  25. extremely odd since Borland is the one calling for a standard set
  26. of method identifiers....
  27.  
  28. Version 1.00: released to the public domain on 8 July 1989.
  29.  
  30.  
  31. TYPE
  32.    LinkList
  33.     = OBJECT(List)
  34.       PROCEDURE Init;
  35.       PROCEDURE Before(TheNode    : NodePtr;
  36.                        BeforeNode : NodePtr);
  37.       PROCEDURE After (TheNode   : NodePtr;
  38.                        AfterNode : NodePtr);
  39.       FUNCTION  Total(TheNode : NodePtr) : LONGINT;
  40.       PROCEDURE Done; VIRTUAL
  41.       END;
  42.  
  43.  
  44. PROCEDURE LinkList.Init;
  45.  
  46.      This procedure initializes the LinkList.
  47.  
  48.  
  49. PROCEDURE LinkList.Before(TheNode    : NodePtr;
  50.                           BeforeNode : NodePtr);
  51.  
  52.      Places TheNode in the LinkList just before BeforeNode.
  53.  
  54.  
  55. PROCEDURE LinkList.After(TheNode   : NodePtr;
  56.                          AfterNode : NodePtr);
  57.  
  58.      Places TheNode in the LinkList just after AfterNode.
  59.  
  60.  
  61. FUNCTION  LinkList.Total(TheNode : NodePtr) : LONGINT;
  62.  
  63.      This function returns a number corresponding to the number
  64. of nodes on the LinkList.  It starts counting from TheNode^.
  65. Therefore, to get a total count of all nodes on the LinkList, use
  66. LinkListVar.Total(LinkListVar.First).  (Remember, we inherit the
  67. "First" function due to OOP.)
  68.  
  69.  
  70. PROCEDURE LinkList.Done;
  71.  
  72.      This procedure deletes all nodes from the list.
  73.